package com.unicomcz.mobile;

import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;

import com.unicomcz.ActionBase;

public class MobInPreAction extends ActionBase {
	private List<MobTypeBean> mobTypes;
	
	public List<MobTypeBean> getMobTypes() {
		return mobTypes;
	}
	public void setMobTypes(List<MobTypeBean> mobTypes) {
		this.mobTypes = mobTypes;
	}
	public MobInPreAction(){
		log = Logger.getLogger(this.getClass());
	}
	public String executeAction(){
		mobTypes  = new ArrayList<MobTypeBean>();
		String str = "select terminal_model_code,terminal_model_name from dls_code_terminal";
		boolean flag = query("dls",mobTypes,str);
		if (flag){
          return SUCCESS;
		}else{
			return "fail";
		}
    }
	@Override
	protected void rs2List(ResultSet rs, List out) throws Exception {
		// TODO Auto-generated method stub
		MobTypeBean mb = new MobTypeBean();
		mb.setModelCode(rs.getString(1));
		mb.setModelName(rs.getString(2));
		out.add(mb);
	}
	
	

}
